package com.gzy.android_douban.ui.home;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.gzy.android_douban.databinding.FragmentHomeBinding;
import com.gzy.android_douban.ui.BaseFragment;



public class HomeFragment extends BaseFragment<FragmentHomeBinding> {
  FragmentHomeBinding binding;

  @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);


  }

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//    return super.onCreateView(inflater, container, savedInstanceState);
    binding = FragmentHomeBinding.inflate(inflater, container,false);
    View view = binding.getRoot();

    dataInit();

    return view;
  }

  private void dataInit() {
    binding.tvTuijian.getPaint().setFakeBoldText(true);
    binding.tvTuijian.setTextSize(24);
    binding.tvTuijian.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        binding.tvTuijian.getPaint().setFakeBoldText(true);
        binding.tvTuijian.setTextSize(24);
        binding.tvGuangchang.getPaint().setFakeBoldText(false);
        binding.tvGuangchang.setTextSize(20);
        binding.tvRebang.getPaint().setFakeBoldText(false);
        binding.tvRebang.setTextSize(20);
      }
    });

    binding.tvGuangchang.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        binding.tvTuijian.getPaint().setFakeBoldText(false);
        binding.tvTuijian.setTextSize(20);
        binding.tvGuangchang.getPaint().setFakeBoldText(true);
        binding.tvGuangchang.setTextSize(24);
        binding.tvRebang.getPaint().setFakeBoldText(false);
        binding.tvRebang.setTextSize(20);
      }
    });

    binding.tvRebang.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        binding.tvTuijian.getPaint().setFakeBoldText(false);
        binding.tvTuijian.setTextSize(20);
        binding.tvGuangchang.getPaint().setFakeBoldText(false);
        binding.tvGuangchang.setTextSize(20);
        binding.tvRebang.getPaint().setFakeBoldText(true);
        binding.tvRebang.setTextSize(24);
      }
    });
  }
}